package mappedClass;

// Generated 3 juil. 2014 12:40:01 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Typetask generated by hbm2java
 */
@Entity
@Table(name = "typetask", catalog = "test", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
public class TypeTask implements java.io.Serializable {

	private Integer id;
	private String name;
	private Set<Task> tasks = new HashSet<Task>(0);

	public TypeTask() {
	}

	public TypeTask(String name) {
		this.name = name;
	}

	public TypeTask(String name, Set<Task> tasks) {
		this.name = name;
		this.tasks = tasks;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name", unique = true, nullable = false, length = 200)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "typetask")
	public Set<Task> getTasks() {
		return this.tasks;
	}

	public void setTasks(Set<Task> tasks) {
		this.tasks = tasks;
	}

	@Override
	public String toString() {
		return "TypeTask [id=" + id + ", name=" + name + ", tasks=" + tasks;
	}

}
